{% extends "admin/base_site.html" %}
{% load i18n %}

{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/dashboard.css{% endblock %}
{% block coltype %}colMS{% endblock %}
{% block bodyclass %}dashboard{% endblock %}
{% block breadcrumbs %}{% endblock %}
{% block content %}
<div id="content-main">

{% load adminapplist %}

{% get_admin_app_list as app_list %}
{% if app_list %}
    {% for app in app_list %}
    
    
    {% ifequal app.name 'Casos' %}
    <div class="module"><h2>Casos</h2><table>
        
        {% if perms.casos.add_caso or perms.casos.change_caso %}
        <tr>
            <th>{% if perms.casos.change_caso %}<a href="casos/caso/">{% endif %}Casos{% if perms.casos.change_caso %}</a>{% endif %}</th>
            <td class="x50">{% if perms.casos.add_caso %}<a href="casos/caso/add/" class="addlink">{% endif %}Agregar{% if perms.casos.add_caso %}</a>{% endif %}</td>
            <td class="x75">{% if perms.casos.change_caso %}<a href="casos/caso/" class="changelink">{% endif %}Modificar{% if perms.casos.change_caso %}</a>{% endif %}</td>
        </tr>
        {% endif %}

        {% if perms.casos.add_imputado or perms.casos.change_imputado %}
        <tr>
            <th>{% if perms.casos.change_imputado %}<a href="casos/imputado/">{% endif %}Imputados{% if perms.casos.change_imputado %}</a>{% endif %}</th>
            <td class="x50">{% if perms.casos.add_imputado %}<a href="casos/imputado/add/" class="addlink">{% endif %}Agregar{% if perms.casos.add_imputado %}</a>{% endif %}</td>
            <td class="x75">{% if perms.casos.change_imputado %}<a href="casos/imputado/" class="changelink">{% endif %}Modificar{% if perms.casos.change_imputado %}</a>{% endif %}</td>
        </tr>
        {% endif %}
        {% if perms.casos.add_querellante or perms.casos.change_querellante %}
        <tr>
            <th>{% if perms.casos.change_querellante %}<a href="casos/querellante/">{% endif %}Querellantes{% if perms.casos.change_querellante %}</a>{% endif %}</th>
            <td class="x50">{% if perms.casos.add_querellante %}<a href="casos/querellante/add/" class="addlink">{% endif %}Agregar{% if perms.casos.add_querellante %}</a>{% endif %}</td>
            <td class="x75">{% if perms.casos.change_querellante %}<a href="casos/querellante/" class="changelink">{% endif %}Modificar{% if perms.casos.change_querellante %}</a>{% endif %}</td>
        </tr>
        {% endif %}
        {% if perms.casos.add_joven or perms.casos.change_joven %}
        <tr>
            <th>{% if perms.casos.change_joven %}<a href="casos/joven/">{% endif %}Jóvenes{% if perms.casos.change_joven %}</a>{% endif %}</th>
            <td class="x50">{% if perms.casos.add_joven %}<a href="casos/joven/add/" class="addlink">{% endif %}Agregar{% if perms.casos.add_joven %}</a>{% endif %}</td>
            <td class="x75">{% if perms.casos.change_joven %}<a href="casos/joven/" class="changelink">{% endif %}Modificar{% if perms.casos.change_joven %}</a>{% endif %}</td>
        </tr>
        {% endif %}
        {% if perms.casos.add_testigo or perms.casos.change_testigo %}
            <tr>
                <th>{% if perms.casos.change_testigo %}<a href="casos/testigo/">{% endif %}Testigos{% if perms.casos.change_testigo %}</a>{% endif %}</th>
                <td class="x50">{% if perms.casos.add_testigo %}<a href="casos/testigo/add/" class="addlink">{% endif %}Agregar{% if perms.casos.add_testigo %}</a>{% endif %}</td>
                <td class="x75">{% if perms.casos.change_testigo %}<a href="casos/testigo/" class="changelink">{% endif %}Modificar{% if perms.casos.change_testigo %}</a>{% endif %}</td>
            </tr>
        {% endif %}
        
        
    </table></div>
    
    {% else %}
    
    
    
        <div class="module">
        <table summary="{% blocktrans with app.name as name %}Models available in the {{ name }} application.{% endblocktrans %}">
        <caption>{% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}</caption>
        {% for model in app.models %}
            <tr>
            {% if model.perms.change %}
                <th scope="row"><a href="{{ model.admin_url }}">{{ model.name }}</a></th>
            {% else %}
                <th scope="row">{{ model.name }}</th>
            {% endif %}

            {% if model.perms.add %}
                <td><a href="{{ model.admin_url }}add/" class="addlink">{% trans 'Agregar' %}</a></td>
            {% else %}
                <td>&nbsp;</td>
            {% endif %}

            {% if model.perms.change %}
                <td><a href="{{ model.admin_url }}" class="changelink">{% trans 'Modificar' %}</a></td>
            {% else %}
                <td>&nbsp;</td>
            {% endif %}
            </tr>
        {% endfor %}
        </table>
        </div>
        
    {% endifequal %}
    {% endfor %}
{% else %}
    <p>{% trans "You don't have permission to edit anything." %}</p>
{% endif %}
</div>
{% endblock %}

{% block sidebar %}
<div id="content-related">
    <div class="module" id="recent-actions-module">
        <h2>{% trans 'Recent Actions' %}</h2>
        <h3>{% trans 'My Actions' %}</h3>
            {% load log %}
            {% get_admin_log 10 as admin_log for_user user %}
            {% if not admin_log %}
            <p>{% trans 'None available' %}</p>
            {% else %}
            <ul class="actionlist">
            {% for entry in admin_log %}
            <li class="{% if entry.is_addition %}addlink{% endif %}{% if entry.is_change %}changelink{% endif %}{% if entry.is_deletion %}deletelink{% endif %}">{% if not entry.is_deletion %}<a href="{{ entry.get_admin_url }}">{% endif %}{{ entry.object_repr|escape }}{% if not entry.is_deletion %}</a>{% endif %}<br /><span class="mini quiet">{% filter capfirst %}{% trans entry.content_type.name %}{% endfilter %}</span></li>
            {% endfor %}
            </ul>
            {% endif %}
    </div>
</div>
{% endblock %}
